﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;

namespace Model.EntityModel.Auth
{
    /// <summary>
    /// 系统用户主表
    /// </summary>
    [SugarTable("USER_MASTER")]
    public class User
    {
        /// <summary>
        /// 用户唯一标识（工号）
        /// </summary>
        [SugarColumn(ColumnName = "USERID", IsPrimaryKey = true)]
        public string UserId { get; set; } = null!;

        /// <summary>
        /// 用户姓名
        /// </summary>
        [SugarColumn(ColumnName = "USERNAME")]
        public string UserName { get; set; } = null!;

        /// <summary>
        /// 加密密码
        /// </summary>
        [SugarColumn(ColumnName = "PASSWORD")]
        public string Password { get; set; } = null!;

        /// <summary>
        /// 密码状态(Y:需修改/N:正常)
        /// </summary>
        [SugarColumn(ColumnName = "PWD_STATUS")]
        public string? PwdStatus { get; set; }

        /// <summary>
        /// 密码过期时间
        /// </summary>
        [SugarColumn(ColumnName = "PWD_EXPIRY_DATE")]
        public DateTime? PwdExpiryDate { get; set; }

        /// <summary>
        /// 用户角色(U:用户/A:管理员/S:超级管理员)
        /// </summary>
        [SugarColumn(ColumnName = "USER_ROLE")]
        public string? UserRole { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [SugarColumn(ColumnName = "USER_PHONENO")]
        public string? UserPhoneNo { get; set; }

        /// <summary>
        /// 电子邮箱
        /// </summary>
        [SugarColumn(ColumnName = "USER_EMAIL")]
        public string? UserEmail { get; set; }

        /// <summary>
        /// 所属部门编码
        /// </summary>
        [SugarColumn(ColumnName = "DEPT_CODE")]
        public string DeptCode { get; set; } = null!;

        /// <summary>
        /// 直属上级
        /// </summary>
        [SugarColumn(ColumnName = "REPORTING_TO")]
        public string? ReportingTo { get; set; }

        /// <summary>
        /// 状态(A:激活/I:失效)
        /// </summary>
        [SugarColumn(ColumnName = "STATUS")]
        public string? Status { get; set; }

        /// <summary>
        /// 最后登录时间
        /// </summary>
        [SugarColumn(ColumnName = "LASTLOGIN_DATE")]
        public DateTime? LastLoginDate { get; set; }

        /// <summary>
        /// 失效时间
        /// </summary>
        [SugarColumn(ColumnName = "INACTIVE_DATE")]
        public DateTime? InactiveDate { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [SugarColumn(ColumnName = "CREATED_BY")]
        public string? CreatedBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "CREATED_AT")]
        public DateTime? CreatedAt { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        [SugarColumn(ColumnName = "MODIFIED_BY")]
        public string? ModifiedBy { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [SugarColumn(ColumnName = "MODIFIED_AT")]
        public DateTime? ModifiedAt { get; set; }
    }
}
